<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="user-scalable=no,width=device-width, initial-scale=1" id="viewport" name="viewport" initial-scale="1">

<script language="javascript" type="text/javascript" src="../js/js/baseJs.js"></script>

</head>
<body>

<div class="share-project" id="shareProject" style="display: none;">
    <div class="wap-header">专属推荐码
        <a class="back" onClick="javascript:window.history.back();return false;"></a>
    </div>
    <div class="share-content" style="margin: 2rem auto;"> 
      <div style="text-align:center;font-size:.3rem;color:#333;">分享二维码邀请朋友</div>
      <div id="qrcode" style="width:200px; height:200px; margin: .2rem auto;"></div>
      
    </div>
</div>
<script src="../js/js/rem_fix.js"></script>
<script src="../js/js/common.js"></script>
<script src="../js/3rd/qrcode.min.js"></script>
<script type="text/javascript">
   var token=getCookie("userToken");
   var userId=getCookie("userId");
   console.log(token)
   console.log(userId)
   var projectId=parseInt(window.location.hash.split("#")[1]) ;
   var invitationCode=window.location.href.split("?")[1];
   var loginUrl="http://"+window.location.host+"/userBundle/register.mobile.html"+"?id=#"+projectId+"&"+invitationCode;
   console.log(loginUrl)
    var qrcode = new QRCode(document.getElementById("qrcode"), {
      width : 200,
      height : 200
    });
  var shareProjectApp = new Vue({
      el: '#shareProject', 
      data: {

      },
      ready:function(){
        $("#shareProject").show();

         this.makeCode();
         console.log(loginUrl)

      }, 
      methods:{
        makeCode:function(){
          if(!invitationCode){
            alert("请登录")
          }
          qrcode.makeCode(loginUrl);
        }
       
      }
    })
</script>

</body>
</html>